<script>
	function drawdpie${chart.id}(){
	var data_${chart.id} = ${resultDatas};
	document.getElementById("div_title_${chart.id}").innerHTML="";
	if('${chart.type}'=='pie'){
	document.getElementById("div_title_${chart.id}").innerHTML="<center style=\"font-size:16px;font-weight:bold;\">${chart.title?default("")}</center>"
															+"<div id=\"pie-${chart.id}\" style=\"width:${chart.width};height:${chart.height};border:0px solid #A4BED4;\"></div>";
	var pieChart${chart.id} =  new dhtmlXChart({
		view:"${chart.type}",
		container:"pie-${chart.id}",
		value:"#${chart.YColumn?upper_case}#",
	    pieInnerText:"#${chart.YColumn?upper_case}#",
		label:"#${chart.XColumn?upper_case}#",
		gradient:true,
		legend:{
			width:${chart.parameterMap.legend_width?default("175")},
			align:"right",
			valign:"middle",
			marker:{
				type:"${chart.parameterMap.marker_type?default("round")}",
				width:${chart.parameterMap.marker_width?default("15")},
				height:${chart.parameterMap.marker_height?default("15")}
			},
			template:"#${chart.XColumn?upper_case}#"
		}
		
	});
	pieChart${chart.id}.parse(data_${chart.id},"json");
	}
	if('${chart.type}'=='pie3D'){
		document.getElementById("div_title_${chart.id}").innerHTML="<center style=\"font-size:16px;font-weight:bold;\">${chart.title?default("")}</center>"
															+"<div id=\"pie3d-${chart.id}\" style=\"width:${chart.width};height:${chart.height};border:0px solid #A4BED4;\"></div>";
	var pie3D${chart.id} =  new dhtmlXChart({
		view:"pie3D",
		container:"pie3d-${chart.id}",
		value:"#${chart.YColumn?upper_case}#",
	    pieInnerText:"#${chart.YColumn?upper_case}#",
		label:"#${chart.XColumn?upper_case}#",
		gradient:true,
		legend:{
			width: ${chart.parameterMap.legend_width?default("175")},
			align:"right",
			valign:"middle",
			marker:{
				type:"${chart.parameterMap.marker_type?default("round")}",
				width:${chart.parameterMap.marker_width?default("15")},
				height:${chart.parameterMap.marker_height?default("15")}
			},
			template:"#${chart.XColumn?upper_case}#"
		}
		
	});
	pie3D${chart.id}.parse(data_${chart.id},"json");
	}
	}
	
	if(${resultDatas}.length>0){
		if (window.addEventListener) {   
			//window.addEventListener('DOMContentLoaded', drawdpie${chart.id}, false);  
			window.addEventListener('load', drawdpie${chart.id}, false);  //firefox
		} else if (window.attachEvent)  {
		  window.attachEvent('onload',drawdpie${chart.id});  //IE
		}
	}else{
		document.getElementById("div_title_${chart.id}").removeNode(true);
		var node=document.getElementById("information");
		if(node){
			node.innerHTML="<span style='color:red;font-size:14;'>提示:查询无数据!</span>";
		}
	}
</script>